package com.whfc.ms.api.emp.service.impl;

import com.whfc.common.result.ListData;
import com.whfc.common.result.PageData;
import com.whfc.emp.dto.AppWorkTypeDTO;
import com.whfc.emp.param.WorkTypeAddParam;
import com.whfc.emp.param.WorkTypeEditParam;
import com.whfc.emp.service.AppEmpWorkService;
import com.whfc.ms.api.emp.service.MsAppEmpWorkService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClasssName MsAppEmpWorkServiceImpl
 * @Description 人员模块-工种字典
 * @Author hw
 * @Date 2020/12/24 10:33
 * @Version 1.0
 */
@Service
public class MsAppEmpWorkServiceImpl implements MsAppEmpWorkService {

    @DubboReference(interfaceClass = AppEmpWorkService.class, version = "1.0.0", timeout = 10 * 1000)
    private AppEmpWorkService appEmpWorkService;

    @Override
    public PageData<AppWorkTypeDTO> workTypeList(Integer deptId, Integer pageNum, Integer pageSize) {
        return appEmpWorkService.workTypeList(deptId, pageNum, pageSize);
    }

    @Override
    public ListData<AppWorkTypeDTO> workTypeList(Integer deptId) {
        List<AppWorkTypeDTO> list = appEmpWorkService.workTypeList(deptId);
        return new ListData<>(list);
    }

    @Override
    public void workTypeAdd(WorkTypeAddParam param) {
        appEmpWorkService.workTypeAdd(param);
    }

    @Override
    public void workTypeEdit(WorkTypeEditParam param) {
        appEmpWorkService.workTypeEdit(param);
    }

    @Override
    public void workTypeDel(Integer id) {
        appEmpWorkService.workTypeDel(id);
    }
}
